#include <iostream>
#include <stdlib.h>
#include <time.h>

using namespace std;

void posNeg()
{
    int arr[50];
    for(int i = 0; i < 50; i++ )
    {
        arr[i] = rand() % 21 - 10;
        cout << arr[i] << "  ";
    }
    int countPositive = 0;
    int countNegative = 1;

    for(int i = 0; i < 50; i++)
    {
        if(arr[i] > 0)
            countPositive++;
        else if(arr[i] < 0)
            countNegative++;
    }

    cout << endl <<endl;
    cout << "Count of positive numbers: " << countPositive << endl;
    cout << "Count of negative numbers: " << countNegative << endl;
    cout << "The count of positive numbers is ";
    if(countPositive > countNegative)
        cout << "greater than";
    else if(countPositive < countNegative)
        cout << "less than";
    else
        cout << "equal to";
    cout << " the count of negative numbers";
    cout << endl << endl << endl;
}

int press0or1()
{
    int num;
    do
    {
        cout << "Press 1 to repeat or 0 to exit: ";
        cin >> num;
    } while(num != 0 && num != 1);

    return num;
}

int main()
{
    int timeNow = time(NULL);
    srand(timeNow);

    int choice = 1;
    while(choice == 1)
    {
        posNeg();
        choice = press0or1();
    }

    return 0;
}
